"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.injectValue = injectValue;

var _isCallable = require("./is-callable");

/**
 * 处理 `R | (...args) => R` 类似类型
 * （ts <= 3.2 时无法依赖 typeof x === "function" 自动推导）
 */
function injectValue(target) {
  return function () {
    return (0, _isCallable.isCallable)(target) ? target.apply(void 0, arguments) : target;
  };
}